package com.standard.py.springbootwebservicedemo.controller;

import com.standard.py.springbootwebservicedemo.service.WebTestService;
import com.standard.py.springbootwebservicedemo.vo.ResponseVo;
import com.standard.py.springbootwebservicedemo.vo.res.RoomMemberResVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * TO DO
 *
 * @author tangjing
 * @date 2021/11/30 10:15
 */

@Api("webservice控制层")
@RestController
@RequestMapping("/webTest")
@Slf4j
public class WebserviceController {

    @Resource
    private WebTestService webService;

    @PostMapping("/query")
    @ApiOperation(value = "查询")
    public ResponseVo<List<RoomMemberResVO>> getUserRooms() {
        List<RoomMemberResVO> result = webService.listMember(1);
        log.info("这是查出的数据：" );
        result.stream().forEach(System.out::println);
        return ResponseVo.content(result);
    }

}
